<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let i
        let rest = 100
        while (true) {
            let i = +prompt(`
            1.存钱
            2.取钱
            3.查看余额
            4.退出`)
            if (i === 4) {
                break
            }
            switch (i) {
                case 1:
                    let a = +prompt('存多少钱')
                    let money = rest + a
                    alert(money)
                    break
                case 2:

                    let b = +prompt('取多少钱')

                    c = rest - b
                    alert(c)
                    break
                case 3:
                    alert(rest)
                    break
                default:
                    alert('你输入有误')
                    break
            }
        }
    </script>
</body>

</html>